1. Field of the Invention
This invention relates to an NFS server, an NFS server control program and an NFS server control method that can suitably be used for an NFS (network file system).
2. Description of the Related Art
To begin with, a known NFS will be described in terms of configuration.
FIG. 3 of the accompanying drawings is a schematic block diagram of a known NFS server, illustrating the configuration and the operation of a lock acquisition process thereof. The illustrated NFS comprises an NFS client 1 and an NFS server 102. The NFS client 1 by turn comprises an application 11, an NLM (network lock manager) 12, an NSM (network status monitor) 13, a lock acquiring server information recording section 14. The NFS server 102 comprises an NLM 122, an NSM 123 and a lock acquiring client information recording section 124. The lock acquiring server information recording section 14 is a nonvolatile recording apparatus for recording a list of the names of the hosts of the NFS server that is acquiring a lock. The lock acquiring client information recording section 124 is also a nonvolatile recording apparatus for recording a list of the names of the hosts of the NFS client that is acquiring a lock.
When the application 11 of the NFS client 1 acquires the lock of a file of the NFS server 102, it executes a lock acquisition process. When the NFS server 102 is restarted for a takeover, for instance, it executes a lock reacquisition process for the file for which the NFS client 1 had acquired the lock before the restart.
Now, the operation of a lock acquisition process of the known NFS will be described below.
Firstly, the application 11 of the NFS client 1 transmits a directive (fcnt1 ( ) system call) for a lock acquisition request to the NLM 12 (S11). Upon receiving the directive, the NLM 12 transmits a directive for recording in the lock acquiring server information recording section 14 to the NSM 13 along with the names of the hosts of the NFS server 102, to which the lock acquiring request is addressed (S12). Upon receiving the directive for recording, the NSM 13 records the names of the hosts of the NFS server 102, if the names have not been recorded yet, in the lock acquiring server information recording section 14 (S13) and returns a response to the directive for recording to the NLM 12 (S14). Upon receiving the response, the NLM 12 transmits a lock acquisition request to the NFS server 102 (S15).
Upon receiving the lock acquiring request, the NLM 122 of the NFS server 102 acquires the lock according to the lock acquisition request and transmits a directive for recording the acquired lock in the lock acquiring client information recording section 124 to the NSM 123 along with the names of the hosts of the lock acquisition requesting NFS client 1 (S21). Upon receiving the directive for recording, the NSM 123 records the names of the hosts of the NFS client 1, if the names have not been recorded yet, in the lock acquiring client information recording section 124 (S22) and returns a response to the directive for recording to the NLM 122 (S23). Upon receiving the response, the NLM 122 transmits a lock response to the NFS client 1 (S24). Upon receiving the lock response, the NLM 12 of the NFS client 1 returns a response to directive of the lock acquisition request to the application 11 (S25) and ends the lock acquisition process.
Thereafter, as long as the NFS client 1 holds the acquired lock, the NFS server 102 keeps the recorded names of the hosts of the NFS client 1, whereas the NFS client 1 keeps the recorded names of the hosts of the NFS server 102.
If the NFS server is restarted typically at the time when a takeover of the NFS server occurs in the NFS having a cluster configuration, the NFS server has forgotten the details of the lock and hence requests the NFS client to reacquire the lock that had been acquired before the restart.
Now, the operation for the lock reacquisition process of the known NFS will be described below.
FIG. 4 is a schematic block diagram of the known NFS server, illustrating the configuration and the operation of a lock reacquisition process thereof. In FIG. 4, the reference symbols same as those of FIG. 3 respectively indicate the objects same as or equivalent to those of FIG. 3 and hence will not be described here any further.
In order to prevent the lock of the file that the NFS client is trying to reacquire from being acquired by some other NFS client, an extended lock reacquisition period (normally about 45 seconds), which is a fixed period, is predefined in the NLM 12. After the restart of the NFS server 102, the NLM 122 starts the extended lock reacquisition period and receives only lock reacquisition requests in this period and does not receive any ordinary lock acquisition request.
Firstly, the NSM 123 of the NFS server 102 reads in the contents of the lock acquiring client information recording section 124 and acquires the names of the hosts (S31), the locks of which had been acquired before the restart. Then, it transmits a notification indicating that the lock needs to be reacquired (SM_NOTIFY) to the NFS client 1 (S32) and deletes the information on the NFS client 1 in the lock acquiring client information recording section 124 (S33).
Upon receiving the notification, the NSM 13 of the NFS client 1 transmits a directive for a lock reacquisition request to the NLM 12 (S34). Upon receiving the directive for a lock reacquisition request, the NLM 12 transmits a lock reacquisition request to the NFS server 102 according to the directive (S35). A lock acquisition request and a lock reacquisition request has a same message format and if the reclaim flag contained in the message is No, it indicates a lock acquisition request but, if the reclaim flag contained in the message is Yes, it indicates a lock reacquisition request.
Upon receiving the lock reacquisition request from the NFS client during the extended lock reacquisition period, the NLM 122 of the NFS server 102 determines if it is a lock reacquisition request or not. If it is a lock reacquisition request, the NLM 122 reacquires the lock and transmits a directive for recording in the lock acquiring client information recording section 124 to the NSM 123 along with the names of the hosts of the lock reacquisition requesting NFS client 1 (S41). During the extended lock reacquisition period, the NLM 122 determines if it is a lock reacquisition request or not according to the reclaim flag of the received message and executes the processing step of S41 if the received message shows a lock reacquisition request (reclaim flag=Yes) but returns an error message to the NFS client who sent the lock acquisition request if the received message shows a lock acquisition request (reclaim flag=No).
Upon receiving the directive for recording, the NSM 123 records the names of the hosts of the NFS client 1 in the lock acquiring client information recording section 124 (S42) and returns a response to the directive for recording to the NLM 122 (S43). Upon receiving the response, the NLM 122 transmits a response to the lock reacquisition request to the NFS client 1 (S44). Upon receiving the response, the NLM 12 of the NFS client 1 transmits a directive for recording in the lock acquiring server information recording section 14 to the NSM 13 along with the names of the hosts of the NFS server 102, to which the lock acquisition request is addressed (S45). Upon receiving the directive for recording, the NSM 13 records the names of the hosts of the NFS server 102 in the lock acquiring server information recording section 14 (S46) and returns a response to the directive for recording to the NLM 12 (S47).
Thereafter, upon receiving a lock reacquisition request from the NFS client, the NLM 122 executes the processing steps of S41 through S47. In the processing step of S41, the NLM 122 determines if the extended lock reacquisition period has elapsed or not and, when the extended lock reacquisition period ends, it terminates the lock reacquisition process. Thereafter, the NLM 122 receives an ordinary lock acquisition request for a lock acquisition process.
As a prior art system that is associated with the present invention, clustering systems having an interface section that is adapted to be driven by a battery and transfer management data to a second server machine when a trouble occurs in a first server machine so that the second server machine continues the service according to the management data are known (see, for example, Patent Document 1: Jpn. Pat. Appln. Laid-Open Publication No. 2003-44310).
However, as the time that needs to be spent for starting a node of a cluster has been reduced and NFS clients have been improved so as to operate at high speed in recent years, the above described extended lock reacquisition period has become too long. Additionally, the time period necessary for reacquiring a lock varies depending on the system and the situation, it is has become difficult for the person who manages the NFS to appropriately predefine the extended lock reacquisition period.